const webpack = require("webpack");
const configs = require("./webpack.config");
const util = require("util");
const pack = util.promisify(webpack);
const rm = util.promisify(require("rimraf"));
const path = require("path");
const resolve = (...uri) => path.join(process.cwd(), ...uri);

(async () => {
  // 生成之前先帮你把dist清空一下
  await rm(resolve("dist", "*"));

  for (const config of configs) {
    await pack(config);
  }
})();
